﻿// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;

namespace System.ComponentModel.Composition
{
    internal class MicroExport
    {
        public MicroExport(Type contractType, params object[] exportedObjects)
            : this(CompositionServices.GetContractName(contractType), exportedObjects)
        {
        }

        public MicroExport(string contractName, params object[] exportedObjects)
            : this(contractName, (IDictionary<string, object>)null, exportedObjects)
        {
        }

        public MicroExport(Type contractType, IDictionary<string, object> metadata, params object[] exportedObjects)
            : this(CompositionServices.GetContractName(contractType), metadata, exportedObjects)
        {
        }

        public MicroExport(string contractName, IDictionary<string, object> metadata, params object[] exportedObjects)
        {
            ContractName = contractName;
            ExportedObjects = exportedObjects;
            Metadata = metadata;
        }

        public string ContractName
        {
            get;
            private set;
        }

        public object[] ExportedObjects
        {
            get;
            private set;
        }

        public IDictionary<string, object> Metadata
        {
            get;
            private set;
        }
    }
}